<template>
  <div class="cy-tabItem1">
    <div class="cy-tabItem1-title">{{ config.name }}</div>
    <div class="cy-tabItem1-line"></div>
    <div class="cy-tabItem1-content">
      <div
        v-for="(item, index) of config.detail"
        :key="index"
      >
        <div class="cy-tabItem1-content-val">
          <div class="cy-tabItem1-content-val-num">
            {{ detail[item.value] || 0 }}
          </div>
          {{ item.unit }}
        </div>
        <div class="cy-tabItem1-content-label">
          {{ item.label }}
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    config: {
      type: Object
    },
    detail: {
      type: Object
    }
  }
}
</script>
<style lang="scss">
.cy-tabItem1 {
  width: 223px;
  height: 79px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: url('~@/assets/img/overview/td-mid-bg.png')
    no-repeat;
  background-size: 100% 100%;
  &-title {
    font-size: 14px;
    line-height: 14px;
    font-family: PingFang SC;
    font-weight: bold;
    color: #000000;
    margin: 0 12px 0 19px;
    writing-mode: tb-rl;
  }
  &-line {
    width: 1px;
    height: 60px;
    background: url('~@/assets/img/overview/zhcy-right-line.png')
      no-repeat;
    background-size: 100% 100%;
  }
  &-content {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    &-val {
      font-size: 14px;
      line-height: 14px;
      font-family: PingFang SC;
      font-weight: 500;
      color: #000000;
      margin-bottom: 8px;
      display: flex;
      align-items: flex-end;
      justify-content: flex-start;
      &-num {
        font-size: 18px;
        line-height: 18px;
        font-family: DIN;
        margin: 0 2px -2px 0;
      }
    }
    &-label {
      font-size: 14px;
      line-height: 14px;
      font-family: PingFang SC;
      font-weight: 400;
      color: #4c565c;
    }
  }
}
</style>
